#ifndef AUTOBAHNWS_H
#define AUTOBAHNWS_H
#include <WebSocketsClient.h>
#include "AutobahnProtoImpl.h"
#include <core_debug.h>

#define PARSER JsonParser
class AutobahnWS: public cautobahnproto_impl{
public:	
    AutobahnWS(){};
    ~AutobahnWS(){};
	void begin(WebSocketsClient &client,const char *host, uint16_t port,   char * realm, const char * url = "/",const char * protocol = "wamp.2.json");
	void beginssl(WebSocketsClient &client,const char *host, uint16_t port,   char * realm, const char * url = "/",const char * protocol = "wamp.2.json");
	void webSocketEvent(WStype_t type, uint8_t * payload, size_t length);
	virtual void send_towire(const char * payload);
    virtual void notify_welcome( );	
    virtual void loop();
    void on_join(t_cb cb);
    
	WebSocketsClient *_client;
	t_cb onjoin_cb = nullptr;
};



#endif
